package com.ccys.db.mapper;

import com.ccys.db.dto.masterData.DiagnosisPageQueryDto;
import com.ccys.db.entity.TblDiagnosis;
import com.ccys.db.vo.doctor.diagnosis.GetAllDiagnosisVo;
import com.ccys.db.vo.doctor.doctorConsultStage.GetDiagnosisByCountryVo;
import com.ccys.db.vo.doctor.doctorConsultStage.GetDiagnosisExclusionVo;
import com.ccys.db.vo.masterData.DiagnosisListVo;
import com.ccys.db.vo.masterData.DiagnosisPageQueryVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

import java.util.List;

/**
* Created by Mybatis Generator on 2023/12/08
*/
public interface TblDiagnosisMapper extends Mapper<TblDiagnosis>, MySqlMapper<TblDiagnosis> {
    List<DiagnosisPageQueryVo> findPage(DiagnosisPageQueryDto dto);

    List<DiagnosisListVo> findList();

    List<GetAllDiagnosisVo> getAllDiagnosisByDoctorId(@Param("doctorId") String doctorId);

    List<GetDiagnosisByCountryVo> getDiagnosisByCountry(@Param("keyword") String keyword,@Param("countryId") String countryId);

    TblDiagnosis findByLikeNameAndByCountryId(@Param("name") String name,@Param("countryId") String countryId);

    List<GetDiagnosisExclusionVo> selectListByListId(@Param("listId")String listId);

    TblDiagnosis findByGroupIdAndByNameOrCode(@Param("groupId") String groupId,@Param("name") String name);

    TblDiagnosis findByNameAndByGroupIdAndByDoctorCountryId(@Param("name") String name,@Param("groupId") String groupId,@Param("doctorCountryId") String doctorCountryId);

    List<TblDiagnosis> findCheckByNameAndByGroupId(@Param("name") String name,@Param("groupId") String groupId);

    /**
     * 根据groupId查询最大的order - 并且返回的是+1之后的值！
     * @param groupId groupId
     * @return
     */
    Integer findMaxDispOrderAddOneByGroupId(@Param("groupId") String groupId);

    TblDiagnosis findOneByNameAndByGroupIdAndByCountryId(@Param("name") String name,@Param("groupId") String groupId,@Param("countryId") String countryId);
}